package com.awesome.activitydemo.activities.transform

import android.app.ActivityOptions
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.awesome.activitydemo.R

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2021/12/27
 * Description:类描述
 */
class OneActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_one)
        val ivImage = findViewById<ImageView>(R.id.image)
        ivImage.setOnClickListener {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                val bundle = ActivityOptions.makeSceneTransitionAnimation(this, ivImage, "activityTransform").toBundle()
                startActivity(Intent(this, TwoActivity::class.java), bundle)
            }
        }
    }
}